/**
 * @file skoll.actions.menu.user.js
 * @author Alejandro Dario Simi
 * @date $Date: 2014-05-04 01:33:52 +0000 (Sun, 04 May 2014) $
 *
 * $Id: skoll.actions.menu.user.js 111 2014-05-04 01:33:52Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/trunk/skins/Skoll/js/skoll.actions.menu.user.js $
 */

Skoll.actions.menu.user = {
	//
	// Protected properties.
	//
	// Public methods.
	login: function() {
		Skoll.tools.log("Skoll.actions.menu.user.login()");
		Skoll.tools.ModalWindow.openModal("?action=content:user:login" + Skoll.tools.extraUrlParams(), function() {
		});
	},
	logout: function() {
		Skoll.tools.log("Skoll.actions.menu.user.logout()");
		Skoll.actions.content.user.logout();
	},
	switchMobile: function() {
		Skoll.tools.log("Skoll.actions.menu.user.switchMobile()");
	},
	switchGroup: function() {
		Skoll.tools.log("Skoll.actions.menu.user.switchGroup()");
		Skoll.tools.ModalWindow.openModal("?action=content:switchgroup&group=" + GROUP_ID + Skoll.tools.extraUrlParams(), function() {
		});
	},
	//
	// Protected methods.
	_bindButtons: function() {
		$(document).on("click", ".wc-usermenu-switchgroup", function() {
			Skoll.actions.menu.user.switchGroup();
		});
		$(document).on("click", ".wc-usermenu-mobile", function() {
			Skoll.actions.menu.user.switchMobile();
		});
		$(document).on("click", ".wc-usermenu-logout", function() {
			Skoll.actions.menu.user.logout();
		});
		$(document).on("click", ".wc-usermenu-login", function() {
			Skoll.actions.menu.user.login();
		});
	}
};

$(document).ready(function() {
	Skoll.actions.menu.user._bindButtons();
});